<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var userinfo = {
        username:'frank',
        say:function(){
            console.log('我是：'+this.username);
        },
        say2:function(){
            this.say();
        }

    }

    userinfo.say2();

    function foo(){
        var o = {
            username:'frank',
            say:function(){
                console.log('我是：'+this.username);
            },
            say2:function(){
                this.say();
            }
        }
        return o;
    }

    var myFoo = foo();
    myFoo.say();

</script>
</body>
</html>